<?php
load()->func('tpl');
global $_W,$_GPC;

if($_W['ispost']){
    $user_data = $_GPC;
    $arr = [];
    
    $arr['name'] = $user_data['name'];
    $arr['phone'] = $user_data['phone'];
    $arr['img'] = $user_data['img'];
    $result = pdo_insert('user', $arr);

    if (!empty($result)) {
        $uid = pdo_insertid();
        message('添加用户成功',$this->createWebUrl('user'),'success');
    }
}

include $this -> template('user_add');